<?php
$this->breadcrumbs = array(
    'Ads'
);
?>
<div class="box">
    <header>
        <h5>Manager List ads <a href="<?php echo url($this->module->id . '/ad/create', array('type' => 'google')) ?>"><i class="icon icon-pencil"></i>Create Ads</a></h5>
    </header>
    <div class="body">
	<?php
	$this->widget('bootstrap.widgets.TbGridView', array(
	    'dataProvider' => $model->searchAds(),
	    'filter' => $model,
	    'columns' => array(
		array(
		    'name' => 'block_id',
		    'header' => 'ID'
		),
		array(
		    'name' => 'type',
		    'type' => 'raw',
		    'value' => 'CHtml::encode($data->getAdType())'
		),
		array(
		    'name' => 'position',
		    'type' => 'raw',
		    'value' => '$data->getPosition()'
		),
		array(
		    'name' => 'status',
		    'type' => 'raw',
		    'value' => '$data->status == 1 ? "Active" : "Disabled" ',
		    'filter' => false
		),
		array(
		    'name' => 'update_time',
		    'type' => 'time',
		    'filter' => false
		),
		array(
		    'class' => 'bootstrap.widgets.TbButtonColumn',
		    'template' => '{update}{delete}',
		    'buttons' => array(
			'update' => array(
			    'label' => 'Update',
			    'url' => '$data->getUpdateUrl()'
			),
			'delete' => array(
			    'label' => 'Delete',
			    'url' => '$data->getDeleteUrl()'
			)
		    )
		),
	    ),
	));
	?>
    </div>
</div>
